package com.calclab.hablar.rooms.client.settings;


public class SelectMediaItemPresenter {

    private final MediaItem item;
    private final SelectMediaItemDisplay display;

    public SelectMediaItemPresenter(final MediaItem item, final SelectMediaItemDisplay display,
	    final boolean selectable) {
	this.item = item;
	this.display = display;
	display.getName().setText(item.getName());
	display.getDescription().setText(item.getDescription());
	display.getSelected().setValue(!selectable);
	display.setSelectEnabled(selectable);
    }
    
    public MediaItem getItem() {
	return item;
    }

    public boolean isSelected() {
	return display.getSelected().getValue();
    }

    public void setEnabled(final boolean enabled) {
	display.setSelectEnabled(enabled);
    }

    public void setSelected(final boolean selected) {
	display.getSelected().setValue(selected);
    }
}
